#!/bin/bash
#
#将/etc/passwd文件内容写入数据库中
cat /etc/passwd | while read line ;do
	num=$(echo "$line" | awk -F : '{printf "\x27%s\x27,\x27%s\x27,%s,%s,\x27%s\x27,\x27%s\x27,\x27%s\x27", $1, $2, $3, $4, $5, $6, $7}'  )
	mysql -uroot -pWWW.1.com -e "insert into test01.user (uname,password,uid,gid,eg,home,shell) values ($num )  "

done
